.class Lcom/burstly/lib/currency/request/LinkUserCallback;
.super Lcom/burstly/lib/network/request/DefaultRequestCallback;
.source "LinkUserCallback.java"


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "<T:",
        "Ljava/lang/Object;",
        ">",
        "Lcom/burstly/lib/network/request/DefaultRequestCallback",
        "<TT;>;"
    }
.end annotation


# static fields
.field private static final INIT_DELAY_VALUE:I = 0xa


# instance fields
.field final mDelayTime:Ljava/util/concurrent/atomic/AtomicLong;

.field private final mNewAccountInfo:Lcom/burstly/lib/currency/AccountInfo;

.field private final mOldAccount:Lcom/burstly/lib/currency/UserAccount;


# direct methods
.method constructor <init>(Lcom/burstly/lib/currency/UserAccount;Lcom/burstly/lib/currency/AccountInfo;)V
    .locals 3
    .parameter "oldAccount"
    .parameter "newAccountInfo"

    .prologue
    .line 59
    .local p0, this:Lcom/burstly/lib/currency/request/LinkUserCallback;,"Lcom/burstly/lib/currency/request/LinkUserCallback<TT;>;"
    invoke-direct {p0}, Lcom/burstly/lib/network/request/DefaultRequestCallback;-><init>()V

    .line 51
    new-instance v0, Ljava/util/concurrent/atomic/AtomicLong;

    const-wide/16 v1, 0xa

    invoke-direct {v0, v1, v2}, Ljava/util/concurrent/atomic/AtomicLong;-><init>(J)V

    iput-object v0, p0, Lcom/burstly/lib/currency/request/LinkUserCallback;->mDelayTime:Ljava/util/concurrent/atomic/AtomicLong;

    .line 60
    iput-object p1, p0, Lcom/burstly/lib/currency/request/LinkUserCallback;->mOldAccount:Lcom/burstly/lib/currency/UserAccount;

    .line 61
    iput-object p2, p0, Lcom/burstly/lib/currency/request/LinkUserCallback;->mNewAccountInfo:Lcom/burstly/lib/currency/AccountInfo;

    .line 62
    return-void
.end method


# virtual methods
.method public onSuccessInBackground(Ljava/lang/Object;)V
    .locals 3
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(TT;)V"
        }
    .end annotation

    .prologue
    .line 66
    .local p0, this:Lcom/burstly/lib/currency/request/LinkUserCallback;,"Lcom/burstly/lib/currency/request/LinkUserCallback<TT;>;"
    .local p1, processResult:Ljava/lang/Object;,"TT;"
    invoke-static {}, Lcom/burstly/lib/currency/UserAccountStorage;->getInstance()Lcom/burstly/lib/currency/UserAccountStorage;

    move-result-object v0

    .line 67
    .local v0, storage:Lcom/burstly/lib/currency/UserAccountStorage;
    iget-object v1, p0, Lcom/burstly/lib/currency/request/LinkUserCallback;->mOldAccount:Lcom/burstly/lib/currency/UserAccount;

    invoke-virtual {v1}, Lcom/burstly/lib/currency/UserAccount;->getCacheFilename()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/burstly/lib/currency/UserAccountStorage;->clearStorage(Ljava/lang/String;)V

    .line 68
    iget-object v1, p0, Lcom/burstly/lib/currency/request/LinkUserCallback;->mOldAccount:Lcom/burstly/lib/currency/UserAccount;

    iget-object v2, p0, Lcom/burstly/lib/currency/request/LinkUserCallback;->mNewAccountInfo:Lcom/burstly/lib/currency/AccountInfo;

    invoke-virtual {v2}, Lcom/burstly/lib/currency/AccountInfo;->getUserId()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/burstly/lib/currency/UserAccount;->setUserId(Ljava/lang/String;)V

    .line 69
    iget-object v1, p0, Lcom/burstly/lib/currency/request/LinkUserCallback;->mOldAccount:Lcom/burstly/lib/currency/UserAccount;

    iget-object v2, p0, Lcom/burstly/lib/currency/request/LinkUserCallback;->mNewAccountInfo:Lcom/burstly/lib/currency/AccountInfo;

    invoke-virtual {v2}, Lcom/burstly/lib/currency/AccountInfo;->getPubId()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/burstly/lib/currency/UserAccount;->setPubId(Ljava/lang/String;)V

    .line 70
    iget-object v1, p0, Lcom/burstly/lib/currency/request/LinkUserCallback;->mOldAccount:Lcom/burstly/lib/currency/UserAccount;

    const/4 v2, 0x0

    invoke-virtual {v1, v2}, Lcom/burstly/lib/currency/UserAccount;->setCacheFilename(Ljava/lang/String;)V

    .line 71
    iget-object v1, p0, Lcom/burstly/lib/currency/request/LinkUserCallback;->mOldAccount:Lcom/burstly/lib/currency/UserAccount;

    invoke-virtual {v0, v1}, Lcom/burstly/lib/currency/UserAccountStorage;->saveAccount(Lcom/burstly/lib/currency/UserAccount;)V

    .line 72
    return-void
.end method
